/**
 * 
 */
package com.starhub.sample.services.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.starhub.sample.dao.TabDAO;
import com.starhub.sample.entities.Tab;
import com.starhub.sample.services.TabService;

/**
 * @author Hoan.NguyenTrong Jan 7, 2015
 * 
 */
@Service(value = "tabService")
@Transactional
public class TabServiceImpl implements TabService {

    @Autowired
    private TabDAO tabDAO;

    public List<Tab> getAllTabs() {

	List<Tab> tabList = tabDAO.getAll();
	return tabList == null ? new ArrayList<Tab>() : tabList;
    }

    public Tab saveOrUpdate(Tab tab) {
	return tabDAO.saveOrUpdate(tab);
    }

}
